﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.HTML
{
    #region Using Statements

    using System;

    #endregion

    public class HTMLOptGroupElement : HTMLElement
    {
        #region Constructors

        internal HTMLOptGroupElement(Document owner)
            : base(owner, "optgroup")
        {
        }

        #endregion

        #region DOM Level 2 HTML Compliance

        /// <summary>
        /// The control is unavailable in this context. See the disabled 
        /// attribute definition in HTML 4.01.
        /// </summary>
        public bool disabled
        {
            get
            {
                return getAttribute("disabled").Equals("disabled");
            }
            set
            {
                setAttribute("disabled", value ? "disabled" : "");
            }
        }

        /// <summary>
        /// Assigns a label to this option group. See the label attribute
        /// definition in HTML 4.01.
        /// </summary>
        public string label
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_LABEL);
            }
            set
            {
                setAttribute(HTMLConstants.HTML_ATT_LABEL, value);
            }
        }

        #endregion
    }
}
